package org.homonoia.model.core;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.ArrayList;

public class Row implements Serializable {

    private static final long serialVersionUID = 6327487828002521516L;
    private int columnIndex = 0;
    private ArrayList<Column> columnList;

    public Row() {
	super();

	columnIndex = 0;
	columnList = new ArrayList<Column>();
    }

    public void insertColumn(final Column col) {
	columnList.add(col);
    }

    public boolean hasMore() {
	return columnIndex < columnList.size();
    }

    public Column current() {
	return columnList.get(columnIndex);
    }

    public void moveNext() {
	columnIndex++;
    }

    private void readObject(ObjectInputStream is) throws ClassNotFoundException, IOException {
	is.defaultReadObject();
    }

    private void writeObject(ObjectOutputStream os) throws IOException {
	os.defaultWriteObject();
    }
}
